package models.corp;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;

import org.hibernate.annotations.ManyToAny;

import play.data.validation.Required;
import play.db.jpa.Model;

import models.User;

@Entity
public class Department extends Model {
	public String name;
	public String info;
	@ManyToOne(cascade = CascadeType.PERSIST)
	public User director;
	@ManyToAny(metaColumn = @Column)
	public List<User> members = new ArrayList<User>();

	public Department(String name, String info) {
		super();
		this.name = name;
		this.info = info;
	}

}
